package com.red.star.macalline.data.mappers;

import com.red.star.macalline.data.core.base.MyMapper;
import com.red.star.macalline.data.entity.StatDynamicTag;
import org.apache.ibatis.annotations.Delete;
import org.apache.ibatis.annotations.Param;
import org.apache.ibatis.annotations.Select;

import java.util.Date;
import java.util.List;

/**
 * @author AMGuo
 * @Description 用户行为dao
 * @date 2018/04/25 12:31
 */
public interface StatDynamicTagMapper extends MyMapper<StatDynamicTag> {

    List<StatDynamicTag> dynamicList(@Param("merchantId") Integer merchantId, @Param("createTime") Date createTime, @Param("employeeId") Integer employeeId, @Param("mallCode") String mallCode);

    List<StatDynamicTag> dynamicHistory(@Param("merchantId") Integer merchantId, @Param("createTime") Date createTime, @Param("employeeId") Integer employeeId, @Param("mallCode") String mallCode);

    List<StatDynamicTag> dynamic(@Param("merchantId") Integer merchantId, @Param("employeeId") Integer employeeId, @Param("mallCode") String mallCode);

    List<StatDynamicTag> footprint(@Param("mallCode") String mallCode, @Param("employeeId") Integer employeeId, @Param("cFansId") Integer cFansId);

    List<StatDynamicTag> footprintList(@Param("mallCode") String mallCode, @Param("employeeId") Integer employeeId, @Param("cFansId") Integer cFansId, @Param("createTime") Date createTime);

    List<StatDynamicTag> footprintHistory(@Param("mallCode") String mallCode, @Param("employeeId") Integer employeeId, @Param("cFansId") Integer cFansId, @Param("createTime") Date createTime);

    StatDynamicTag findByCondition(StatDynamicTag tag);

    @Select(value = "select * from stat_dynamic_tag t where t.chat_session_id = #{chatSessionId}")
    StatDynamicTag findByChatSessionId(String chatSessionId);

    @Delete(value = "delete from stat_dynamic_tag where chat_session_id = #{chatSessionId}")
    int deleteByChatSessionId(String chatSessionId);

    int updateByChatSessionId(String chatSessionId);
}
